Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

make sure deserialize function recongnises awkward0 name as well #260

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

kgizdov
Copy link
Member

@kgizdov kgizdov commented Jan 25, 2021

as the title says. Test before were failing with:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

storage = {'': b'{"awkward0": "0.15.2", "schema": {"call": ["awkward0", "numpy", "frombuffer"], "args": [{"read": "0"}, {"dtype"...7, 78, 79, 80, 81, 82, 83, 84,
       85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99],
      dtype=uint16)}
name = ''
whitelist = [['numpy', 'frombuffer'], ['zlib', 'decompress'], ['lzma', 'decompress'], ['backports.lzma', 'decompress'], ['lz4.block', 'decompress'], ['awkward0', '*Array'], ...]
cache = None, seen = None

    def deserialize(storage, name="", whitelist=whitelist, cache=None, seen=None):
        import awkward0.array.virtual

        schema = storage[name]
        if isinstance(schema, numpy.ndarray):
            schema = schema.tostring()
        if isinstance(schema, bytes):
            schema = schema.decode("ascii")
        schema = json.loads(schema)

        if "awkward" not in schema:
>           raise ValueError("JSON object is not an Awkward Array schema (missing 'awkward' field)")
E           ValueError: JSON object is not an Awkward Array schema (missing 'awkward' field)

awkward0/persist.py:515: ValueError

@jpivarski
Copy link
Member

Thanks! Having just tested it, I'll bump the version and deploy it to PyPI.

@jpivarski jpivarski merged commit 3ba6eb1 into scikit-hep:master Jan 25, 2021
@jpivarski
Copy link
Member

It's on PyPI: https://pypi.org/project/awkward0/0.15.3/#history

Thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants